import request from '@/config/axios'

// 获取所有启用的导入模板列表
export const getImportTemplateList = () => {
  return request.get({ url: '/product/import-template/list' })
}

// 根据模板编码下载导入模板
export const downloadImportTemplate = async (templateCode) => {
  return await request.download({
    url: '/product/spu/get-import-template-by-code',
    params: { templateCode }
  })
}

// 按模板导入商品
export const importSpuByTemplate = (data) => {
  return request.upload({
    url: '/product/spu/import-by-template',
    data
  })
}
